import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)



const router = new VueRouter({
    routes: [{
            path: '/',
            component: () =>
                import ('../views/layout/index.vue'),
            children: [{
                    path: '',
                    name: 'home',
                    component: () =>
                        import ('../views/home/home.vue')
                },
                {
                    path: '/goods',
                    name: 'goods',
                    component: () =>
                        import ('../views/goods/goods')
                }, {
                    path: '/needs',
                    name: 'needs',
                    component: () =>
                        import ('../views/needs/needs')
                }, {
                    path: '/my',
                    name: 'my',
                    component: () =>
                        import ('../views/my/my')
                },

            ]

        },
        {
            path: '/goodsid/:id',
            name: 'goodsid',
            component: () =>
                import ('../views/goodItem/goodscon'),
            props: true
        },
        {
            path: '/needsid/:id',
            name: 'needsid',
            component: () =>
                import ('../views/needs/needItem'),
            props: true
        },
        {
            path: '/login',
            name: 'login',
            component: () =>
                import ('../views/my/login')

        },
        {
            path: '/admin/cate',
            name: 'admincate',
            component: () =>
                import ('../views/admin/cate')

        },
        {
            path: '/fabu',
            name: 'fabu',
            component: () =>
                import ('../views/fabu/fabu')
        },
        {
            path: '/qiugou',
            name: 'qiugou',
            component: () =>
                import ('../views/qiugou/qiugou')
        },
        {
            path: '/myfabu',
            name: 'myfabu',
            component: () =>
                import ('../views/my/myfabu')
        }, {
            path: '/myqiu',
            name: 'myqiu',
            component: () =>
                import ('../views/my/muqiu')
        }

    ]
})

export default router